# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-mock
_pkgname=mock
pkgver=3.0.5
pkgrel=9
pkgdesc='Rolling backport of unittest.mock for all Pythons.'
url='https://pypi.org/project/mock/#files'
arch=('any')
license=('BSD')
depends=('python2' 'python2-pbr' 'python2-six' 'python2-funcsigs')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('536ab1f0f1448373e9d75e43c6fdb0434adacf0d2cf6eecfe7e590b096c7314914d8e5c20211f196abc59ecb88eb0bf902ae01e7b06d6892e7c0be9d4e35a049')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

